package entity

import (
	"shqsoft.cn/pasnj/base"

	"github.com/jinzhu/gorm"
)

//BaseYYCB 国际结算量导入
type BaseYYCB struct {
	ID   int     `gorm:"AUTO_INCREMENT;primary_key;column:ID"`
	DTID int     `gorm:"column:DTID"`
	UTID int     `gorm:"column:UTID"`
	BMMC string  `gorm:"column:BMMC"`
	YYCB float64 `gorm:"column:YYCB"`
}

//TableName 随借随还短贷宝导入表
func (BaseYYCB) TableName() string {
	return "T_BASE_YYCB"
}

//SjshDdbAfterImport 导入后执行
func BaseYYCBAfterImport(tx *gorm.DB, params map[string]string) (err error) {
	prams := make([]interface{}, 1)
	prams[0] = params["DTID"]
	tx.Exec("EXEC UP_BASE_YYCB ?", prams...)
	return nil
}

//BaseYYCBEF 返回结构体
func BaseYYCBEF() base.EntityFunc {
	return func() interface{} {
		entity := BaseYYCB{}
		return &entity
	}
}

//BaseYYCBESF 返回结构体数组
func BaseYYCBESF() base.EntitiesFunc {
	return func() interface{} {
		var entities []BaseYYCB
		return &entities
	}
}

func init() {
	base.DaoPoolObj.Put("BaseYYCB", base.NewDefaultDao(BaseYYCBEF(), BaseYYCBESF(), nil))
	base.SetAfterCallBack("BaseYYCB", BaseYYCBAfterImport)
}
